﻿using UnityEngine;
using System.Collections;

public class TestAssetBundle : MonoBehaviour {

	// Use this for initialization
	void Start () {
		StartCoroutine (loadAssetBundle());
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	IEnumerator loadAssetBundle() {
		string path = "file://" + Application.dataPath + "/testsprite";
		Debug.Log (path);
		WWW www = new WWW (path);
		yield return www;
		if (www.isDone) {
			Debug.Log ("load ok!");
		}
		if (www.assetBundle == null) {
			Debug.Log ("assetbundle  is null");
		}
		Object[] objects = www.assetBundle.LoadAllAssets ();
		foreach (Object obj in objects) {
			Debug.Log (obj.GetType () + " " + obj.name);
		}
		yield return 0;
	}
}
